<?
$this->breadcrumbs = array(
	$album->title => $this->createUrl('/album/view', array('id' => $album->aid)),
	$photo->name,
);
$attachment = Yii::app()->attachment;
Yii::app()->clientScript->registerLessFile(Yii::getPathOfAlias('views.layouts.less') . '/' . $this->module->id . '.less');
?>
<section class="container">
	<div class="row mb10">
		<div class="span12">
			<div class="clearfix mb10">
				<ul class="about-option">
					<li><i class="icon-eye-open"></i> <?=$photo->views?> </li>
					<li><i class="icon-heart"></i> <?=$photo->likes?> </li>
					<li><i class="icon-comment"></i> <?=$photo->replies?> </li>
				</ul>
			</div>
			<div class="photo-view">
				<?=CHtml::image($photo->getThumb($photo->path, 'view', true))?>
			</div>
			<div class="photo-info">
				<h4><?=$photo->name?></h4>
				<div>
					<h3><?=$photo->description?></h3>
				</div>
			</div>
		</div>
		<!--<div class="span4">
			<div class="photo-setting">
				<h5>作者</h5>
				<div class="photo-settings-wrapper">
					
				</div>
				<h5>图片列表</h5>
				<div class="photo-settings-wrapper">
					
				</div>
				<h5>其他资讯</h5>
				<div class="photo-settings-wrapper">
					
				</div>
				<h5>隐私</h5>
				<div class="photo-settings-wrapper">
					
				</div>
			</div>
		</div>-->
	</div>
	<div class="row">
		<div class="span8">
			<div class="comment-list">
				<?$this->renderPartial('_photoComment', array(
					'commentDataProvider' => $commentDataProvider
				))?>
			</div>
			<?php $form = $this->beginWidget('CActiveForm', array(
					'id' => 'albumComment',
			));?>
				<fieldset class="album-comment">
					<?if(Yii::app()->user->isGuest):?>
						<div class="control-group">
							<?=$form->labelEx($comment, 'author', array('class' => 'control-label')); ?>
		                    <div class="controls">
		                        <?=$form->textField($comment, 'author', array('class' => 'input-large')); ?>
		                        <?=$form->error($comment, 'author', array('class' => 'help-inline')); ?>
		                    </div>
						</div>
					<?endif;?>
					<div class="control-group">
						<?=$form->labelEx($comment, 'comment', array('class' => 'control-label')); ?>
						<div class="controls">
	                        <?=$form->textArea($comment, 'comment', array(
								'class' => 'span8',
								'placeholder' => Yii::t('album', '作品如何?')
							))?>
	                        <?=$form->error($comment, 'comment', array('class' => 'help-inline')); ?>
	                    </div>
					</div>
					<?=CHtml::submitButton('提交', array('id' => 'commentBtn', 'class' => 'btn btn-tall btn-wide btn-small btn-primary pull-right'))?>
				</fieldset>
			<?$this->endWidget()?>
		</div>
		<div class="span4"></div>
	</div>
</section>
<?php 
$script = <<<EOF
Core.use('global', 'timeago', function(){
	//表单提交时按钮不可以用
	var commentBtn = $('#commentBtn');
	commentBtn.click(function(){
		Core.Util.btnDisable(commentBtn);
	});
	//设置人性化时间
	Core.Util.updateTime($('time'));
});
EOF;
Yii::app()->clientScript->registerScript($this->id, $script);
Yii::app()->clientScript->registerLessFile(Yii::getPathOfAlias('views.layouts.less.' . $this->module->id ) . '/' . $this->id . '.less');
?>